\(\int \cos (c+d x) \sin ^2(c+d x) (a+a \sin (c+d x)) \, dx\) [190]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 25, antiderivative size = 33 \[ \int \cos (c+d x) \sin ^2(c+d x) (a+a \sin (c+d x)) \, dx=\frac {a \sin ^3(c+d x)}{3 d}+\frac {a \sin ^4(c+d x)}{4 d} \]

[Out]

1/3*a*sin(d*x+c)^3/d+1/4*a*sin(d*x+c)^4/d

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {2912, 12, 45} \[ \int \cos (c+d x) \sin ^2(c+d x) (a+a \sin (c+d x)) \, dx=\frac {a \sin ^4(c+d x)}{4 d}+\frac {a \sin ^3(c+d x)}{3 d} \]

[In]

Int[Cos[c + d*x]*Sin[c + d*x]^2*(a + a*Sin[c + d*x]),x]

[Out]

(a*Sin[c + d*x]^3)/(3*d) + (a*Sin[c + d*x]^4)/(4*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2912

Int[cos[(e_.) + (f_.)*(x_)]*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)
])^(n_.), x_Symbol] :> Dist[1/(b*f), Subst[Int[(a + x)^m*(c + (d/b)*x)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[
{a, b, c, d, e, f, m, n}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {x^2 (a+x)}{a^2} \, dx,x,a \sin (c+d x)\right )}{a d} \\ & = \frac {\text {Subst}\left (\int x^2 (a+x) \, dx,x,a \sin (c+d x)\right )}{a^3 d} \\ & = \frac {\text {Subst}\left (\int \left (a x^2+x^3\right ) \, dx,x,a \sin (c+d x)\right )}{a^3 d} \\ & = \frac {a \sin ^3(c+d x)}{3 d}+\frac {a \sin ^4(c+d x)}{4 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.00 \[ \int \cos (c+d x) \sin ^2(c+d x) (a+a \sin (c+d x)) \, dx=\frac {a \sin ^3(c+d x)}{3 d}+\frac {a \sin ^4(c+d x)}{4 d} \]

[In]

Integrate[Cos[c + d*x]*Sin[c + d*x]^2*(a + a*Sin[c + d*x]),x]

[Out]

(a*Sin[c + d*x]^3)/(3*d) + (a*Sin[c + d*x]^4)/(4*d)

Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.85

method result size
derivativedivides \(\frac {\frac {a \left (\sin ^{4}\left (d x +c \right )\right )}{4}+\frac {a \left (\sin ^{3}\left (d x +c \right )\right )}{3}}{d}\) \(28\)
default \(\frac {\frac {a \left (\sin ^{4}\left (d x +c \right )\right )}{4}+\frac {a \left (\sin ^{3}\left (d x +c \right )\right )}{3}}{d}\) \(28\)
parallelrisch \(\frac {a \left (-12 \cos \left (2 d x +2 c \right )+3 \cos \left (4 d x +4 c \right )+9-8 \sin \left (3 d x +3 c \right )+24 \sin \left (d x +c \right )\right )}{96 d}\) \(50\)
risch \(\frac {a \sin \left (d x +c \right )}{4 d}+\frac {a \cos \left (4 d x +4 c \right )}{32 d}-\frac {a \sin \left (3 d x +3 c \right )}{12 d}-\frac {a \cos \left (2 d x +2 c \right )}{8 d}\) \(59\)
norman \(\frac {\frac {8 a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {8 a \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {4 a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}\) \(69\)

[In]

int(cos(d*x+c)*sin(d*x+c)^2*(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(1/4*a*sin(d*x+c)^4+1/3*a*sin(d*x+c)^3)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.52 \[ \int \cos (c+d x) \sin ^2(c+d x) (a+a \sin (c+d x)) \, dx=\frac {3 \, a \cos \left (d x + c\right )^{4} - 6 \, a \cos \left (d x + c\right )^{2} - 4 \, {\left (a \cos \left (d x + c\right )^{2} - a\right )} \sin \left (d x + c\right )}{12 \, d} \]

[In]

integrate(cos(d*x+c)*sin(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/12*(3*a*cos(d*x + c)^4 - 6*a*cos(d*x + c)^2 - 4*(a*cos(d*x + c)^2 - a)*sin(d*x + c))/d

Sympy [A] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.27 \[ \int \cos (c+d x) \sin ^2(c+d x) (a+a \sin (c+d x)) \, dx=\begin {cases} \frac {a \sin ^{4}{\left (c + d x \right )}}{4 d} + \frac {a \sin ^{3}{\left (c + d x \right )}}{3 d} & \text {for}\: d \neq 0 \\x \left (a \sin {\left (c \right )} + a\right ) \sin ^{2}{\left (c \right )} \cos {\left (c \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(d*x+c)*sin(d*x+c)**2*(a+a*sin(d*x+c)),x)

[Out]

Piecewise((a*sin(c + d*x)**4/(4*d) + a*sin(c + d*x)**3/(3*d), Ne(d, 0)), (x*(a*sin(c) + a)*sin(c)**2*cos(c), T
rue))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.85 \[ \int \cos (c+d x) \sin ^2(c+d x) (a+a \sin (c+d x)) \, dx=\frac {3 \, a \sin \left (d x + c\right )^{4} + 4 \, a \sin \left (d x + c\right )^{3}}{12 \, d} \]

[In]

integrate(cos(d*x+c)*sin(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/12*(3*a*sin(d*x + c)^4 + 4*a*sin(d*x + c)^3)/d

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.85 \[ \int \cos (c+d x) \sin ^2(c+d x) (a+a \sin (c+d x)) \, dx=\frac {3 \, a \sin \left (d x + c\right )^{4} + 4 \, a \sin \left (d x + c\right )^{3}}{12 \, d} \]

[In]

integrate(cos(d*x+c)*sin(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

1/12*(3*a*sin(d*x + c)^4 + 4*a*sin(d*x + c)^3)/d

Mupad [B] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.73 \[ \int \cos (c+d x) \sin ^2(c+d x) (a+a \sin (c+d x)) \, dx=\frac {a\,{\sin \left (c+d\,x\right )}^3\,\left (3\,\sin \left (c+d\,x\right )+4\right )}{12\,d} \]

[In]

int(cos(c + d*x)*sin(c + d*x)^2*(a + a*sin(c + d*x)),x)

[Out]

(a*sin(c + d*x)^3*(3*sin(c + d*x) + 4))/(12*d)